package com.rc.saas.mini.client;

import com.rc.saas.mini.common.base.TResponse;
import com.rc.saas.mini.vo.cec.StdRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 标准通讯协议B区充电桩服务器
 * value 和 name 互为别名，也是指被调用的微服务名称。
 * path如果是本机开发模式,一般不需设置,如果在生产上一个tomcat部署多个项目，一定需设置为项目的子路径
 * @FeignClient(name = "服务名") 亦可写作 @FeignClient(value= "服务名")
 * Created by sven on 2019/10/25
 */
@Component
@FeignClient(name = StdEvchargerClient2.SERVICE_NAME, path = StdEvchargerClient2.SERVICE_PATH)
//name是服务方的spring.application.name,指被调用的微服务名称
public interface StdEvchargerClient2 {
    //项目名称
    String SERVICE_NAME = "rc-evcharger2";
    //项目部署的路径
    String SERVICE_PATH = "/rc-evcharger";

    /**
     * 下达开始充电指令
     * RequestMapping路径是服务提供方的路径
     * @param tRequest
     * @return
     */
    @RequestMapping(value = "/wechat/query_start_charge", method = RequestMethod.POST)
    TResponse query_start_charge(@RequestBody StdRequest tRequest);

    /**
     * 下达结束充电指令
     * RequestMapping路径是服务提供方的路径
     * @param tRequest
     * @return
     */
    @RequestMapping(value = "/wechat/query_stop_charge", method = RequestMethod.POST)
    TResponse query_stop_charge(@RequestBody StdRequest tRequest);

    /**
     * 后台结算订单
     * RequestMapping路径是服务提供方的路径
     * @param orderId
     * @return
     */
    @RequestMapping(value = "/order/updateOrder", method = RequestMethod.POST)
    TResponse updateOrder(@RequestParam(name = "orderId")Long orderId);
}
